<?php

namespace app\common\validate\Hotel;

// 引入Thinkphp底层的验证器
use think\Validate;

/**
 * 定义订单验证器
 */
class Order extends Validate{
    // 设置我们要验证的字段规则
    protected $rule = [
        'busid' => ['require'],
        'roomid' => ['require'],
        'oprice' => ['require'],
        'price' => ['require'],
        'starttime' => ['require'],
        'endtime' => ['require'],
        'guest' => ['require'],
        'status' => ['require','in:-1,-2,-3,1,2,3,4']

    ];

    /**
     * 设置错误的提示信息
     */
    protected $message = [
        'busid.require' => '用户未知',
        'roomid.require' => '房间未知',
        'oprice.require' => '原价必填',
        'price.require' => '实际支付金额必填',
        'starttime.require' => '入住时间必填',
        'endtime.require' => '退房时间必填',
        'guest.require' => '住户必填',
        'status.require' => '订单状态必填',
        'status.in' => '订单状态未知'
    ];

    /**
     * 设置验证器的场景
     */
    protected $scene = [
    ];
}

?>
